﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using Model;
using WebService.Datalayer;
using System.Data;

namespace WebService
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
    {
        DBBooking dbBooking = new DBBooking();
        DBBookingDetails dbBookingDetails = new DBBookingDetails();
        DBHistoryBooking dbHistoryBooking = new DBHistoryBooking();
        DBHistoryMenus dbHistoryMenus = new DBHistoryMenus();
        DBMenus dbMenus = new DBMenus();
        DBMenuTypes dbMenuTypes = new DBMenuTypes();
        DBRegions dbRegions = new DBRegions();
        DBRoles dbRoles = new DBRoles();
        DBStaff dbStaff = new DBStaff();
        DBTables dbTables = new DBTables();
        DBUnits dbUnits = new DBUnits();

        [WebMethod]
        public string HelloWorld()
        {
            
            return "Hello World";
        }

        #region dbUnits
        /// <summary>
        /// SelectUnitsAll
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectUnitsAll()
        {
            return dbUnits.SelectUnitsAll();
        }

        /// <summary>
        /// SelectUnit
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectUnitsByAndUnitID(int Id)
        {
            return dbUnits.SelectUnitsByAndUnitID(new Units(Id));
        }

        /// <summary>
        /// InsertUnit
        /// </summary>
        /// <param name="Id"></param>
        /// <param name="Name"></param>
        /// <param name="description"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int InsertUnit(string name, string description)
        {
            return dbUnits.InsertUnit(new Units(0, name, description, false));
        }

        /// <summary>
        /// UpdateUnit
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <param name="description"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int UpdateUnit(int id, string name, string description, bool isDeleted)
        {
            return dbUnits.UpdateUnit(new Units(id, name, description, isDeleted));
        }

        /// <summary>
        /// DeleteUnit
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        [WebMethod]
        public int DeleteUnit(int Id)
        {
            return dbUnits.DeleteUnit(new Units(Id));
        }

        /// <summary>
        ///  SelectUnitsByAndUnitID
        /// </summary>
        /// <param name="unitID"></param>
        /// <returns></returns>
       
        #endregion

        #region dbBooking
        /// <summary>
        /// SelectBookingsAll
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectBookingsAll()
        {
            return dbBooking.SelectBookingsAll();
        }

        /// <summary>
        /// SelectMaxBookingNumberInDate
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public string SelectMaxBookingNumberInDate()
        {
            return dbBooking.SelectMaxBookingNumberInDate();
        }

        /// <summary>
        /// SelectMaxBookingId
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public string SelectMaxBookingId()
        {
            return dbBooking.SelectMaxBookingId();
        }

        /// <summary>
        /// InsertBooking
        /// </summary>
        /// <param name="tableId"></param>
        /// <param name="staffID"></param>
        /// <param name="bookingNumber"></param>
        /// <param name="bookingDate"></param>
        /// <param name="totalAmount"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int InsertBooking(int tableId, int staffID, string bookingNumber, System.DateTime bookingDate, int totalAmount)
        {
            return dbBooking.InsertBooking(new Bookings(0, tableId, staffID, bookingNumber, bookingDate, totalAmount, false));
        }

        /// <summary>
        /// UpdateBooking
        /// </summary>
        /// <param name="bookingID"></param>
        /// <param name="tableId"></param>
        /// <param name="staffID"></param>
        /// <param name="bookingNumber"></param>
        /// <param name="bookingDate"></param>
        /// <param name="totalAmount"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int UpdateBooking(int bookingID,int tableId,int staffID, string bookingNumber, System.DateTime bookingDate, int totalAmount, bool isDeleted)
        {
            return dbBooking.UpdateBooking(new Bookings(bookingID, tableId, staffID, bookingNumber, bookingDate, totalAmount, isDeleted));
        }

        /// <summary>
        /// DeleteBooking
        /// </summary>
        /// <param name="bookingID"></param>
        /// <returns></returns>
        [WebMethod]
        public int DeleteBooking(int bookingID)
        {
            return dbBooking.DeleteBooking(new Bookings(bookingID));
        }

        /// <summary>
        /// SelectBookingsByAndBookingID
        /// </summary>
        /// <param name="bookingID"></param>
        /// <returns></returns>
         [WebMethod]
        public DataSet SelectBookingsByAndBookingID(int bookingID)
        {
            return dbBooking.SelectBookingsByAndBookingID(new Bookings(bookingID));
        }

         /// <summary>
         /// SelectBookingByStaffID
         /// </summary>
         /// <param name="bookingID"></param>
         /// <returns></returns>
         [WebMethod]
         public DataSet SelectBookingByStaffID(int StaffID)
         {
             return dbBooking.SelectBookingByStaffID(StaffID);
         }

         /// <summary>
         /// SelectBookingByTableID
         /// </summary>
         /// <param name="bookingID"></param>
         /// <returns></returns>
         [WebMethod]
         public DataSet SelectBookingByTableID(int TableID)
         {
             return dbBooking.SelectBookingByTableID(TableID);
         }
        #endregion

        #region dbBookingDetails
        /// <summary>
        /// SelectDBBookingDetailsAll
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectBookingDetailsAll()
        {
            return dbBookingDetails.SelectBookingDetailsAll();
        }

        /// <summary>
        /// InsertBookingDetail
        /// </summary>
        /// <param name="bookingDetailID"></param>
        /// <param name="bookingID"></param>
        /// <param name="menuID"></param>
        /// <param name="status"></param>
        /// <param name="price"></param>
        /// <param name="quantity"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int InsertBookingDetail(int bookingID, int menuID, string status, int price, int quantity)
        {
            return dbBookingDetails.InsertBookingDetail(new BookingDetails(0, bookingID, menuID, status, price, quantity, false));
        }

        /// <summary>
        /// UpdateBookingDetail
        /// </summary>
        /// <param name="bookingDetailID"></param>
        /// <param name="bookingID"></param>
        /// <param name="menuID"></param>
        /// <param name="status"></param>
        /// <param name="price"></param>
        /// <param name="quantity"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int UpdateBookingDetail(int bookingDetailID, int bookingID, int menuID, string status, int price, int quantity, bool isDeleted)
        {
            return dbBookingDetails.UpdateBookingDetail(new BookingDetails(bookingDetailID, bookingID, menuID, status, price, quantity, isDeleted));
        }

        /// <summary>
        /// DeleteBookingDetail
        /// </summary>
        /// <param name="bookingDetailID"></param>
        /// <returns></returns>
        [WebMethod]
        public int DeleteBookingDetail(int bookingID)
        {
            return dbBookingDetails.DeleteBookingDetail(bookingID);
                 
        }

        /// <summary>
        /// SelectBookingDetailsByAndBookingDetailID
        /// </summary>
        /// <param name="bookingDetailID"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectBookingDetailsByAndBookingDetailID(int bookingDetailID)
        {
            return dbBookingDetails.SelectBookingDetailsByAndBookingDetailID(new BookingDetails(bookingDetailID));
        }

        /// <summary>
        /// SelectBookingDetailsByBookingID
        /// </summary>
        /// <param name="bookingDetailID"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectBookingDetailsByBookingID(int BookingId)
        {
            return dbBookingDetails.SelectBookingDetailsByBookingID(BookingId);
        }
        #endregion

        #region dbRegions
        /// <summary>
        /// SelectRegions
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectRegionsAll()
        {
            return dbRegions.SelectRegionsAll();
        }

        /// <summary>
        /// SelectRegionsByAndRegionID
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectRegionsByAndRegionID(int regionID)
        {
            return dbRegions.SelectRegionsByAndRegionID(new Regions(regionID));
        }

        /// <summary>
        /// DeleteRegion
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        [WebMethod]
        public int DeleteRegion(int regionID)
        {
            return dbRegions.DeleteRegion(new Regions(regionID));
        }

        /// <summary>
        /// InsertRegion
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        [WebMethod]
        public int InsertRegion(string regionName, string description)
        {
            return dbRegions.InsertRegion(new Regions(0, regionName, description, false));
        }

        /// <summary>
        /// UpdateRegion
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        [WebMethod]
        public int UpdateRegion(int regionID, string regionName, string description)
        {
            return dbRegions.UpdateRegion(new Regions(regionID, regionName, description, true));
        }
       
        #endregion

        #region dbHistoryBooking
        /// <summary>
        /// SelectHistoryBookingsAll
        /// </summary>
        /// <returns></returns>
          [WebMethod]
        public DataSet SelectHistoryBookingsAll()
        {
            return dbHistoryBooking.SelectHistoryBookingAll();
        }

        /// <summary>
        /// SelectHistoryBookingsAll
        /// </summary>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectHistoryBookingByDateTime(string from, string to)
        {
            return dbHistoryBooking.SelectHistoryBookingByDateTime(from,to);
        }
        /// <summary>
        /// InsertHistoryBooking
        /// </summary>
        /// <param name="historyBookingID"></param>
        /// <param name="bookingID"></param>
        /// <param name="oldMenuID"></param>
        /// <param name="newMenuID"></param>
        /// <param name="reason"></param>
        /// <param name="isDeleted"></param>
        /// <param name="bookingNumber"></param>
        /// <returns></returns>
          [WebMethod]
        public int InsertHistoryBooking(int bookingID, int oldMenuID, int newMenuID, string reason, string bookingNumber)
        {
            return dbHistoryBooking.InsertHistoryBooking(new HistoryBookings(0, bookingID, oldMenuID, reason, false, bookingNumber));
        }

        /// <summary>
        /// UpdateHistoryBooking
        /// </summary>
        /// <param name="historyBookingID"></param>
        /// <param name="bookingID"></param>
        /// <param name="oldMenuID"></param>
        /// <param name="newMenuID"></param>
        /// <param name="reason"></param>
        /// <param name="isDeleted"></param>
        /// <param name="bookingNumber"></param>
        /// <returns></returns>
                  [WebMethod]
        public int UpdateHistoryBooking(int historyBookingID, int bookingID, int oldMenuID, string reason, bool isDeleted, string bookingNumber)
        {
            return dbHistoryBooking.UpdateHistoryBooking(new HistoryBookings(historyBookingID, bookingID, oldMenuID, reason, isDeleted, bookingNumber));
        }

        /// <summary>
        /// DeleteHistoryMenu
        /// </summary>
        /// <param name="historyBookingID"></param>
        /// <returns></returns>
          [WebMethod]
        public int DeleteHistoryMenu(int historyBookingID)
        {
            return dbHistoryBooking.DeleteHistoryBooking(new HistoryBookings(historyBookingID));
        }

        /// <summary>
        ///SelectHistoryBookingsByAndHistoryBookingID
        /// </summary>
        /// <param name="historyBookingID"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectHistoryBookingsByAndHistoryBookingID(int historyBookingID)
        {
            return dbHistoryBooking.SelectHistoryBookingsByAndHistoryBookingID(new HistoryBookings(historyBookingID));
        }
        #endregion

        #region dbHistoryMenus
        /// <summary>
        /// SelectHistoryMenusAll
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectHistoryMenusAll()
        {
            return dbHistoryMenus.SelectHistoryMenusAll();
        }

        /// <summary>
        /// InsertHistoryMenu
        /// </summary>
        /// <param name="historyMenuID"></param>
        /// <param name="menuID"></param>
        /// <param name="price"></param>
        /// <param name="createDate"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>

        [WebMethod]
        public int InsertHistoryMenu(int menuID, int price, System.DateTime createDate)
        {
            return dbHistoryMenus.InsertHistoryMenu(new HistoryMenus(0, menuID, price, createDate, false));
               
        }

        /// <summary>
        /// UpdateHistoryMenu
        /// </summary>
        /// <param name="historyMenuID"></param>
        /// <param name="menuID"></param>
        /// <param name="price"></param>
        /// <param name="createDate"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int UpdateHistoryMenu(int historyMenuID, int menuID, int price, System.DateTime createDate, bool isDeleted)
        {
            return dbHistoryMenus.UpdateHistoryMenu(new HistoryMenus(menuID, menuID, price, createDate, isDeleted));
        }

        /// <summary>
        /// DeleteHistoryMenu
        /// </summary>
        /// <param name="historyMenuID"></param>
        /// <returns></returns>
        

        /// <summary>
        /// SelectHistoryMenusByAndHistoryMenuID
        /// </summary>
        /// <param name="historyMenuID"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectHistoryMenusByAndHistoryMenuID(int historyMenuID)
        {
            return dbHistoryMenus.SelectHistoryMenusByAndHistoryMenuID(new HistoryMenus(historyMenuID));
        }

        #endregion

        #region dbMenus
        /// <summary>
        /// SelectMenusAll
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectMenusAll()
        {
            return dbMenus.SelectMenusAll();
        }

        /// <summary>
        /// InsertMenu
        /// </summary>
        /// <param name="menuID"></param>
        /// <param name="menuTypeID"></param>
        /// <param name="menuName"></param>
        /// <param name="price"></param>
        /// <param name="unitID"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int InsertMenu(int menuTypeID, string menuName, int price, int unitID, int total, string picture)
        {
            return dbMenus.InsertMenu(new Menus(0, menuTypeID, menuName, price, unitID, false, total, picture));
        }

        /// <summary>
        /// UpdateMenu
        /// </summary>
        /// <param name="menuID"></param>
        /// <param name="menuTypeID"></param>
        /// <param name="menuName"></param>
        /// <param name="price"></param>
        /// <param name="unitID"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int UpdateMenu(int menuID, int menuTypeID, string menuName, int price, int unitID, bool isDeleted, int total, string picture)
        {
            return dbMenus.UpdateMenu(new Menus(menuID, menuTypeID, menuName, price, unitID, isDeleted, total, picture));
        }

        /// <summary>
        /// DeleteMenu
        /// </summary>
        /// <param name="menuID"></param>
        /// <returns></returns>
        [WebMethod]
        public int DeleteMenu(int menuID)
        {
            return dbMenus.DeleteMenu(new Menus(menuID));
        }

        /// <summary>
        /// SelectMenusByAndMenuID
        /// </summary>
        /// <param name="menuID"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectMenusByAndMenuID(int menuID)
        {
            return dbMenus.SelectMenusByAndMenuID(new Menus(menuID));
        }
        #endregion

        #region dbMenuTypes
        /// <summary>
        /// SelectMenuTypesAll
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectMenuTypesAll()
        {
            return dbMenuTypes.SelectMenuTypesAll();
        }

        /// <summary>
        /// InsertMenuType
        /// </summary>
        /// <param name="menuTypeID"></param>
        /// <param name="menuTypeName"></param>
        /// <param name="description"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int InsertMenuType(string menuTypeName, string description)
        {
            return dbMenuTypes.InsertMenuType(new MenuTypes(0, menuTypeName, description, false));
        }

        /// <summary>
        /// UpdateMenuType
        /// </summary>
        /// <param name="menuTypeID"></param>
        /// <param name="menuTypeName"></param>
        /// <param name="description"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int UpdateMenuType(int menuTypeID, string menuTypeName, string description, bool isDeleted)
        {
            return dbMenuTypes.UpdateMenuType(new MenuTypes(menuTypeID, menuTypeName, description, isDeleted));
        }

        /// <summary>
        /// DeleteMenuType
        /// </summary>
        /// <param name="menuTypeID"></param>
        /// <returns></returns>
        [WebMethod]
        public int DeleteMenuType(int menuTypeID)
        {
            return dbMenuTypes.DeleteMenuType(new MenuTypes(menuTypeID));
        }

        /// <summary>
        /// SelectMenuTypesByAndMenuTypeID
        /// </summary>
        /// <param name="menuTypeID"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectMenuTypesByAndMenuTypeID(int menuTypeID)
        {
            return dbMenuTypes.SelectMenuTypesByAndMenuTypeID(new MenuTypes(menuTypeID));
        }
        #endregion

        #region dbRoles
        /// <summary>
        /// SelectRolesAll
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectRolesAll()
        {
            return dbRoles.SelectRolesAll();
        }

        /// <summary>
        /// InsertRole
        /// </summary>
        /// <param name="roleID"></param>
        /// <param name="roleName"></param>
        /// <param name="isDelete"></param>
        /// <returns></returns>
        [WebMethod]
        public int InsertRole(string roleName)
        {
            return dbRoles.InsertRole(new Roles(0, roleName, false));
        }

        /// <summary>
        /// UpdateRole
        /// </summary>
        /// <param name="roleID"></param>
        /// <param name="roleName"></param>
        /// <param name="isDelete"></param>
        /// <returns></returns>
        [WebMethod]
        public int UpdateRole(int roleID, string roleName, bool isDelete)
        {
            return dbRoles.UpdateRole(new Roles(roleID, roleName, isDelete));
        }

        /// <summary>
        /// DeleteRole
        /// </summary>
        /// <param name="roleID"></param>
        /// <returns></returns>
        [WebMethod]
        public int DeleteRole(int roleID)
        {
            return dbRoles.DeleteRole(new Roles(roleID));
        }

        /// <summary>
        /// SelectRolesByAndRoleID
        /// </summary>
        /// <param name="roleID"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectRolesByAndRoleID(int roleID)
        {
            return dbRoles.SelectRolesByAndRoleID(new Roles(roleID));
        }
        #endregion

        #region dbStaffs
        
        /// <summary>
        /// SelectStaffsAll
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectStaffsAll()
        {
            return dbStaff.SelectStaffsAll();
        }

        /// <summary>
        /// InsertStaff
        /// </summary>
        /// <param name="staffID"></param>
        /// <param name="roleID"></param>
        /// <param name="userName"></param>
        /// <param name="address"></param>
        /// <param name="birthDate"></param>
        /// <param name="gender"></param>
        /// <param name="noNumber"></param>
        /// <param name="phoneNumber"></param>
        /// <param name="startWorkDate"></param>
        /// <param name="endWorkDate"></param>
        /// <param name="createDate"></param>
        /// <param name="isDeleted"></param>
        /// <param name="enable"></param>
        /// <param name="password"></param>
        /// <param name="staffName"></param>
        /// <returns></returns>
        [WebMethod]
        public int InsertStaff(int roleID, string userName, string address, System.DateTime birthDate, bool gender, string noNumber, string phoneNumber, System.DateTime startWorkDate, System.DateTime endWorkDate, System.DateTime createDate, bool enable, string password, string staffName, string imei)
        {
            return dbStaff.InsertStaff(new Staffs(0, roleID, userName, address, birthDate, gender, noNumber, phoneNumber, startWorkDate, endWorkDate, createDate, false, enable, password, staffName, imei));
        }

        /// <summary>
        /// UpdateStaff
        /// </summary>
        /// <param name="staffID"></param>
        /// <param name="roleID"></param>
        /// <param name="userName"></param>
        /// <param name="address"></param>
        /// <param name="birthDate"></param>
        /// <param name="gender"></param>
        /// <param name="noNumber"></param>
        /// <param name="phoneNumber"></param>
        /// <param name="startWorkDate"></param>
        /// <param name="endWorkDate"></param>
        /// <param name="createDate"></param>
        /// <param name="isDeleted"></param>
        /// <param name="enable"></param>
        /// <param name="password"></param>
        /// <param name="staffName"></param>
        /// <returns></returns>
        [WebMethod]
        public int UpdateStaff(int staffID, int roleID, string userName, string address, System.DateTime birthDate, bool gender, string noNumber, string phoneNumber, System.DateTime startWorkDate, System.DateTime endWorkDate, System.DateTime createDate, bool enable, string password, string staffName, string imei)
        {
            return dbStaff.UpdateStaff(new Staffs(staffID, roleID, userName, address, birthDate, gender, noNumber, phoneNumber, startWorkDate, endWorkDate, createDate, false, enable, password, staffName, imei));
        }

        /// <summary>
        /// DeleteStaff
        /// </summary>
        /// <param name="staffID"></param>
        /// <returns></returns>
        [WebMethod]
        public int DeleteStaff(int staffID)
        {
            return dbStaff.DeleteStaff(new Staffs(staffID));
        }

        /// <summary>
        /// SelectStaffsByAndStaffID
        /// </summary>
        /// <param name="staffID"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectStaffsByAndStaffID(int staffID)
        {
            return dbStaff.SelectStaffsByAndStaffID(new Staffs(staffID));
        }

        /// <summary>
        /// SelectLogin
        /// </summary>
        /// <param name="staffID"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectLogin(string userName)
        {
            return dbStaff.SelectLogin(userName);
        }

        /// <summary>
        /// SelectLoginUser
        /// </summary>
        /// <param name="staffID"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectLoginUser(string userName, string password)
        {
            Authentication authen = new Authentication();
            password = authen.Encrypt(password);
            return dbStaff.SelectLoginUser(userName, password);
        }

        #endregion

        #region dbTables
        
        /// <summary>
        /// SelectTablesAll
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectTablesAll()
        {
            return dbTables.SelectTablesAll();
        }

        /// <summary>
        /// InsertTable
        /// </summary>
        /// <param name="tableID"></param>
        /// <param name="tableName"></param>
        /// <param name="regionID"></param>
        /// <param name="description"></param>
        /// <param name="isBank"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int InsertTable(string tableName, int regionID, string description, bool isBank)
        {
            return dbTables.InsertTable(new Tables(0, tableName, regionID, description, isBank, false));
        }

        /// <summary>
        /// UpdateTable
        /// </summary>
        /// <param name="tableID"></param>
        /// <param name="tableName"></param>
        /// <param name="regionID"></param>
        /// <param name="description"></param>
        /// <param name="isBank"></param>
        /// <param name="isDeleted"></param>
        /// <returns></returns>
        [WebMethod]
        public int UpdateTable(int tableID, string tableName, int regionID, string description, bool isBank, bool isDeleted)
        {
            return dbTables.UpdateTable(new Tables(tableID, tableName, regionID, description, isBank, isDeleted));
        }

        /// <summary>
        /// DeleteTable
        /// </summary>
        /// <param name="tableID"></param>
        /// <returns></returns>
        [WebMethod]
        public int DeleteTable(int tableID)
        {
            return dbTables.DeleteTable(new Tables(tableID));
        }

        /// <summary>
        /// SelectTablesByAndTableID
        /// </summary>
        /// <param name="tableID"></param>
        /// <returns></returns>
        [WebMethod]
        public DataSet SelectTablesByAndTableID(int tableID)
        {
            return dbTables.SelectTablesByAndTableID(new Tables(tableID));
        }
        #endregion

    }
}